package handling

import client.MapleClient
import handling.opcode.RecvPacketOpcode
import io.netty.channel.Channel
import io.netty.channel.ChannelHandlerContext
import tools.data.input.ByteArrayByteStream
import tools.data.input.GenericSeekableLittleEndianAccessor
import tools.data.input.SeekableLittleEndianAccessor

class RecvPacketEntry(ctx: ChannelHandlerContext, val msg: Any, val client: MapleClient, val type: ServerType) {
    val channel: Channel = ctx.channel()
    val slea: SeekableLittleEndianAccessor = GenericSeekableLittleEndianAccessor(ByteArrayByteStream(msg as ByteArray))
    val head = slea.readShort()
    val recv: RecvPacketOpcode? = RecvPacketOpcode.getByType(head.toInt())
}




